package com.cloud.cloudvideo.rabbitmq;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cloud.cloudvideo.service.VideoMediaService;
import com.rabbitmq.client.Channel;

/**
 * @author James.li
 * @version 1.0
 * @date 2020-03-21 13:15
 */
@Component
public class MsgReceiver {


    @Autowired
    private VideoMediaService videoMediaService;

//    @Autowired
//    private VideoPhotoService videoPhotoService;

    @RabbitListener(queues = RabbitConfig.QUEUE_VIDEO_TRANSCODE, containerFactory = "multiListenerContainer")
    public void process( Channel channel, Message message) throws Exception {
    	videoMediaService.transforMedia(channel,message);
    }
}
